Field
The described embodiments relate to electronic devices. More specifically, the disclosed embodiments relate to sending messages to receiving electronic devices using a message server.
Related Art
Some modern electronic devices (smart phones, laptop computers, etc.) include a message application that users can use to send messages to electronic devices for other users (i.e., to the message application on the electronic devices for the other users). For example, these electronic devices may include a message application such as the Messages application from Apple Inc. of Cupertino, Calif. that enables users to send messages with text, photos, video, documents, contacts, etc. to other users. Some message applications support group messaging, meaning that a user can use the message application to simultaneously send a message to electronic devices for a group of two or more other users.
Generally, when a user sends a message to another user, the user provides, to the message application on a sending electronic device, a handle for the other user and a payload of the message. For example, the user can provide a handle such as an email address, a phone number, and/or another piece of information that can be used to identify the user or an account for the user, and a payload such as text, one or more photos, etc. The sending electronic device then sends a request to an identity server for an identification of electronic devices associated with the handle (i.e., each of the other user's electronic devices). The identity server uses the handle to look up electronic devices associated with the handle and returns, for each of one or more electronic devices associated with the handle, a corresponding push token and session token. Next, the sending electronic device generates a separate request message for each of the other user's electronic devices, each request message including a corresponding one of the returned push tokens and the corresponding session token, as well as the payload. The sending electronic device then separately sends each of the request messages to a message server to be forwarded to the corresponding one of the other user's electronic devices. The message server, for each received request message, verifies, using the session token, that the sending electronic device is permitted to send messages to the corresponding one of the other user's electronic devices. The message server then uses the push token to locate the corresponding one of the other user's electronic devices and sends a message including the payload to the corresponding one of the other user's electronic devices.
When a user sends a group message, the user provides, to the message application on a sending electronic device, two or more handles for the other users (i.e., handles for each user in a group of users) and a payload of the message. The above-described process is then performed for each of the handles. Thus, the sending electronic device sends, to the message server, a separate message for each electronic device associated with the each of the handles. Because each handle may be associated with multiple electronic devices (e.g., a user's laptop, smart phone, tablet computer, set top box, etc.), multiple separate messages may be sent from the sending electronic device to the message server when sending a group message.
Because there are many users using electronic devices that provide the message application, and sending a message to each electronic device associated with a handle (or a group of handles) is performed using the message server as described above, a very large number of messages are received by message server(s). This necessitates the provision of large numbers of highly-available message servers and places considerable loads on the message servers.
In addition, some of the message applications encrypt messages separately for each receiving electronic device. Thus, the sending device has a separate encryption key for each electronic device associated with a handle to which messages are to be sent, and each electronic device associated with a handle to which messages are to be sent has a corresponding decryption key. Because, as described above, each handle may be associated with multiple electronic devices and group messages may be sent to multiple handles, multiple separate messages may need to be encrypted by the sending electronic device to generate corresponding requests to the message server. This places an appreciable computational load on sending electronic devices.
In the figures, like reference numerals refer to the same figure elements.